package com.huawei.appgallery.forum.message.widget;

import android.content.Context;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.huawei.appgallery.forum.message.bean.ReminderSubReference;
import o.bqx;
import o.brg;
import o.bvj.b;
import o.bvj.e;
import o.eqx;
import o.fho;

public class SubReferenceView extends RelativeLayout {
    private brg ʻ;
    private Context ʽ;
    private View ˊ;
    private TextView ˋ;
    private TextView ˎ;
    private ImageView ˏ;
    View ॱ;

    public SubReferenceView(Context context) {
        super(context);
        this.ʽ = context;
        ˋ(context);
    }

    public SubReferenceView(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
        this.ʽ = context;
        ˋ(context);
    }

    public SubReferenceView(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        this.ʽ = context;
        ˋ(context);
    }

    private void ˋ(Context context) {
        this.ॱ = LayoutInflater.from(context).inflate(e.ᐝॱ, this);
        this.ʻ = (brg) fho.ˏ().ˋ("Base").ॱ(brg.class);
        this.ˏ = (ImageView) this.ॱ.findViewById(b.ˊʻ);
        this.ˎ = (TextView) this.ॱ.findViewById(b.ˊʼ);
        this.ˋ = (TextView) this.ॱ.findViewById(b.ʼᐝ);
        this.ˊ = this.ॱ.findViewById(b.ʽˊ);
    }

    public void setReference(final ReminderSubReference reminderSubReference) {
        eqx.ˏ(this.ˏ, reminderSubReference.ˋ(), "app_default_icon");
        this.ˎ.setText(reminderSubReference.ॱ());
        if (!TextUtils.isEmpty(reminderSubReference.ˊ())) {
            this.ˋ.setText(reminderSubReference.ˊ());
            this.ˋ.setVisibility(0);
        }
        if (!TextUtils.isEmpty(reminderSubReference.ˎ())) {
            this.ˊ.setOnClickListener(new OnClickListener(this) {
                final /* synthetic */ SubReferenceView ˏ;

                public void onClick(View view) {
                    this.ˏ.ˏ(reminderSubReference.ˎ());
                }
            });
        }
        if (!TextUtils.isEmpty(reminderSubReference.ˏ())) {
            this.ॱ.setOnClickListener(new OnClickListener(this) {
                final /* synthetic */ SubReferenceView ˎ;

                public void onClick(View view) {
                    this.ˎ.ॱ(reminderSubReference.ˏ());
                }
            });
        }
    }

    private void ˏ(String str) {
        bqx.ˏ("SubReferenceView", "onHeadClick");
        this.ʻ.ˏ(this.ʽ, str);
    }

    private void ॱ(String str) {
        bqx.ˏ("SubReferenceView", "onContentClick");
        this.ʻ.ˏ(this.ʽ, str);
    }
}
